home *** CD-ROM | disk | FTP | other *** search
/ Aminet 1 / Aminet - June 1993 [Walnut Creek].iso / usenet / sources / volume91 / shells / cshel510 / part03 < prev    next >
Encoding:
Internet Message Format  |  1991-04-16  |  48.8 KB

  1. Path: news.larc.nasa.gov!amiga-request
  2. From: amiga-request@ab20.larc.nasa.gov (Amiga Sources/Binaries Moderator)
  3. Subject: v91i090: CShell 5.10 - alternative command interface, Part03/06
  4. Reply-To: umueller@iiic.ethz.ch
  5. Newsgroups: comp.sources.amiga
  6. Message-ID: <comp.sources.amiga:v91i090@ab20.larc.nasa.gov>
  7. References: <comp.sources.amiga:v91i088@ab20.larc.nasa.gov>
  8. Date: 16 Apr 91 19:34:37 GMT
  9. Approved: tadguy@uunet.UU.NET (Tad Guy)
  10. X-Mail-Submissions-To: amiga@uunet.uu.net
  11. X-Post-Discussions-To: comp.sys.amiga.misc
  12.  
  13. Submitted-by: umueller@iiic.ethz.ch
  14. Posting-number: Volume 91, Issue 090
  15. Archive-name: shells/cshell-5.10/part03
  16.  
  17. #!/bin/sh
  18. # This is a shell archive.  Remove anything before this line, then unpack
  19. # it by saving it into a file and typing "sh file".  To overwrite existing
  20. # files, type "sh file -c".  You can also feed this as standard input via
  21. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  22. # will see the following message at the end:
  23. #        "End of archive 3 (of 6)."
  24. # Contents:  csh.doc.ab csh.doc.ac
  25. # Wrapped by tadguy@ab20 on Tue Apr 16 15:34:35 1991
  26. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  27. if test -f 'csh.doc.ab' -a "${1}" != "-c" ; then 
  28.   echo shar: Will not clobber existing file \"'csh.doc.ab'\"
  29. else
  30. echo shar: Extracting \"'csh.doc.ab'\" \(22783 characters\)
  31. sed "s/^X//" >'csh.doc.ab' <<'END_OF_FILE'
  32. X    by Cursor-Up + RETURN). You will cycle through all directories
  33. X    that matched the given abbreviation. The other possibility is to
  34. X    specify the full name of the parent directory: cd devs/keym
  35. X    You may also add devices and assigns, so if 'PageStream:' is one
  36. X    line in the qcd-file, a cd to 'page' is successful.
  37. X
  38. X    CD without any arguments displays the path of the directory you
  39. X    are currently in.
  40. X
  41. X    CLASS
  42. X    Usage    : [-n] name {type=param} [ "actions" {action=command} ]
  43. X    Example : class zoo offs=20,dca7c4fd ext=.zoo actions view="zoo l"
  44. X
  45. X    Defines a new class of files and the actions to be taken on them
  46. X    in various cases, or shows old definitions if given no arguments.
  47. X    See section XIV: OBJECTS
  48. X    Options:
  49. X      -n (new)  forgets old definitions
  50. X
  51. X
  52. X    CLOSE
  53. X    Usage    : close [filenumber]
  54. X
  55. X    Close the specified file opened by open. Without filenumber, closes
  56. X    all open files. See open and flist for more info.
  57. X
  58. X    CLS
  59. X    Usage    : cls
  60. X
  61. X    This is an alias. It only clears the screen, but also works on a
  62. X    terminal (e ^L doesn't).
  63. X
  64. X    COPY (CP)
  65. X    Usage    : copy [-udfpm]  file file
  66. X    or    : copy [-udfpm]  file1 file2...fileN dir
  67. X    or    : copy [-rudfp] dir1...dirN file1...fileN dir
  68. X
  69. X    Options    :
  70. X      -r recursive, copy all subdirectories as well.
  71. X      -u update, if newer version exists on dest, don't copy
  72. X      -f freshen, if file doesn't exist on dest or newer, don't copy
  73. X      -d don't set destination file date to that of source.
  74. X      -p don't set destination protection bits to those of source.
  75. X      -m erases the original. does not work with -r
  76. X
  77. X    Example    : copy -r df0: df1:
  78. X
  79. X    Copy files or directories. When copying directories, the -r option
  80. X    must be specified to copy subdirectories as well.  Otherwise, only
  81. X    top level files in the source directory are copied.
  82. X
  83. X    All files will be displayed as they are copied and directory's
  84. X    displayed as they are created. This output can be suppessed by
  85. X    redirecting to nil: eg. copy -r >nil: df0: df1:
  86. X
  87. X    Copy will abort after current file on Control-C.
  88. X
  89. X    Copy by default sets the date of the destination file to that of
  90. X    the source file. To overide this feature use the -d switch.
  91. X
  92. X    Similarly, it sets protection bits (flags) to those of source and
  93. X    any file comment will be copied. To avoid this use -p. The archive
  94. X    bit is always cleared.
  95. X
  96. X    Another useful option is the -u (update) mode were copy will not
  97. X    copy any files which exists already in the destination directory
  98. X    if the destination file is newer or equal to the source file.
  99. X    This is useful when developing code say in ram: eg. 'copy *.c ram:'
  100. X    when done you can copy -u ram: df1: and only those modules you have
  101. X    modified will be copied back.
  102. X
  103. X    Copy command will now create the destination directory if it does
  104. X    not exist when specified as 'copy [-r] dir dir'. If you specify
  105. X    copy file file file dir, then 'dir' must already exist.
  106. X
  107. X    CP
  108. X    Equivalent to copy.
  109. X
  110. X    DATE
  111. X    Usage    : date [-sr] [new date and/or time]
  112. X    Example    : date Wednesday  # this refers to NEXT wed, of course
  113. X
  114. X    Used to read or set system date and/or time. All standard options
  115. X    may be used (yesterday, tomorrow, monday, etc.).
  116. X    Leading zero's are not necessary.
  117. X    Without parameters shows Dddddd DD-MMM-YY HH:MM:SS.
  118. X    Options:
  119. X      -s stores the current time
  120. X      -r shows time relative to last stored in secs and hunderths
  121. X
  122. X    DEC
  123. X    Usage    : dec varname [value]
  124. X    Example    : dec abc
  125. X
  126. X    Decrement the numerical equivalent of the variable with specified
  127. X    value (default: 1) and place the ASCII-string result back into
  128. X    that variable.
  129. X
  130. X    DELETE (RM)
  131. X    Usage    : delete [-p][-r] file file file...
  132. X    Example    : delete foo.txt test.c
  133. X
  134. X    Remove (delete) the specified files.  Remove always returns
  135. X    errorcode 0.  You can remove empty directories.  The '-r' option
  136. X    will remove non-empty directories by recursively removing all sub
  137. X    directories.
  138. X    You can remove delete-protected files specifying -p option.
  139. X    If you specify any wildcard deletes the files will be listed as
  140. X    they are deleted. This can be suppressed by redirecting to nil:
  141. X
  142. X    DIR     (LS)
  143. X    Usage    : dir [-abcdfhiklnoqstuv] [-z lformat] [path path ... ]
  144. X    Example    : dir -ts downloads:
  145. X          dir -lz "%7s %-.16n %m" *.c
  146. X    Options:
  147. X     -d list directories only
  148. X     -f list files only
  149. X     -h list only files which not start with a dot, end with '.info' or
  150. X        have the h-flag set.
  151. X     -s short multi(4) column display.
  152. X     -c don't change colors for directories
  153. X     -q quiet display. does not show length in blocks
  154. X     -o display file nOtes
  155. X     -n display names only
  156. X     -p display full path names and suppress directory titles
  157. X     -a shows the age of all files in the format  days hours:minutes
  158. X     -i identifies every file, shows the type instead of the date.
  159. X        See chapter XIV CLASSES
  160. X     -v (viewdir) recursively sums up lengths of the files in a dir
  161. X     -l sorts the files by their length, longest first.
  162. X     -t sorts the files by their time, most recent first.
  163. X     -k sorts the files by their class (klass)
  164. X     -b sorts the files backwards.
  165. X     -g prints directories at the beGinning
  166. X     -e prints directories at the End
  167. X     -u must be given exactly two directories. Shows files only in
  168. X        the first directory, files in both and files in the second.
  169. X     -z custom format
  170. X
  171. X    Displays a directory of specified files. Default output shows
  172. X    date, protection, block size, byte size and total space used.
  173. X    Protections flags include new 1.2/1.3 flags (see under protect),
  174. X    plus a 'c' flag which indicates that this file has a comment.
  175. X    Files are alphabetically sorted, without case sensitivity, and
  176. X    directories are in red pen (unless you use -c). Dir takes in
  177. X    account the width of your window.
  178. X
  179. X    The lformat string is used to create your own directory format.
  180. X    It will override all else. It may contain the following codes:
  181. X     %a age               %m multi column    %t time
  182. X     %b size in blocks    %n name            %u size in K
  183. X     %c flag c (comment)  %o file note       %v dir size in eng
  184. X     %d date              %p name w/ path    %w dir size in K
  185. X     %f flags hsparwed    %q name w/ slash   %x translated date
  186. X     %i flag d (dIr)      %r size in eng
  187. X     %k class             %s size
  188. X    Between the '%' and the identifying letter, there may be an optional
  189. X    field width. If the number is preceded by a '-', the field contents
  190. X    will be left adjusted. If by a dot, the contents will be cut down
  191. X    to match the field width if they are longer.
  192. X    If the format string contains a %m, cshell will try to print more
  193. X    than one entry on one line. The column width is the field width of
  194. X    the %m entry. If omitted, it's assumed to be the one of the first 
  195. X    file. If a file is longer, it will use two columns.
  196. X
  197. X    DISKCHANGE
  198. X    Usage    : diskchange drive
  199. X
  200. X    Like AmigaDOS diskchange.
  201. X
  202. X    ECHO
  203. X    Usage    : echo [-en] string
  204. X    Example    : echo hi there
  205. X    Results    : hi there
  206. X
  207. X    Echo the string given. If -n switch given no newline is
  208. X    appended. If -e is on, echo to stderr.
  209. X
  210. X    ELSE
  211. X    Usage    : else ; command
  212. X    Usage    : if -f foo.c ; else ; echo "Not there" ; endif
  213. X
  214. X    Else clause, must follow an IF statement.
  215. X
  216. X    ENDIF
  217. X    Usage    : endif
  218. X
  219. X    The end of an if statement.
  220. X
  221. X    Note: if you return from a script file with unterminated IF's
  222. X    and the last IF was false, prompt will be changed to an
  223. X    underscore ('_') and no commands will be executed until
  224. X    'endif' is typed.
  225. X
  226. X    EXEC
  227. X    Usage    : exec command [args]
  228. X    Example    : set util SYS:sytem/utilities
  229. X          exec $util/make    # would not work without exec
  230. X
  231. X    Execute the command specified; exec command is equivalent to
  232. X    command, only you can use variables to specify command name.
  233. X    Note that the command line is parsed TWICE, so the commands
  234. X       set a dir ram:; exec $a              # right
  235. X    works fine, but
  236. X       set a mkdir; exec $a "My directory"  # wrong!
  237. X    would create two directories.
  238. X
  239. X    FAULT
  240. X    Usage    : fault error1 .. errorN
  241. X    Example    : fault 205 212
  242. X
  243. X    Like AmigaDOS fault, prints specified error messages.
  244. X
  245. X    FILENOTE
  246. X    Usage    : filenote file1 .. fileN  note
  247. X          filenote -s file1...fileN
  248. X
  249. X    The first form sets AmigaDOS comment of the specified file.
  250. X    The second form display the file notes of the given files.
  251. X
  252. X    FLIST
  253. X    Usage    : flist
  254. X
  255. X    Lists the filenumbers of files opened by open.
  256. X    See open and close for more info.
  257. X
  258. X    FLTLOWER
  259. X    Usage    : fltlower
  260. X    Example    : dir | fltlower
  261. X    Or    : fltlower <readme
  262. X
  263. X    This is a filter command, i.e. it reads from stdin and writes to
  264. X    stdout. The more natural way to use it is a pipe, or it can be
  265. X    redirected.
  266. X    Its purpose is to convert all alphabetic to lower case.
  267. X
  268. X    FLTUPPER
  269. X    The same of fltlower, only this converts to upper case.
  270. X
  271. X    FOREACH
  272. X    Usage    : foreach [-v] varname ( strings ) command
  273. X    Example    : foreach i ( a b c d ) "echo -n $i;echo \" ha\""
  274. X    Result    : a ha
  275. X          b ha
  276. X          c ha
  277. X          d ha
  278. X
  279. X    'strings' is broken up into arguments.  Each argument is placed in
  280. X    the variable 'varname' in turn and 'command' executed.  To execute
  281. X    multiple commands, place them in quotes.
  282. X
  283. X    Foreach is especially useful when interpreting passed arguments in
  284. X    an alias.
  285. X
  286. X    eg.
  287. X        foreach i ( *.pic ) viewilbm $i
  288. X    assuming a.pic and b.pic in current directory the following commands
  289. X    will occur:
  290. X        viewilbm a.pic
  291. X        viewilbm b.pic
  292. X
  293. X    Flag -v causes arguments to be displayed every time command is
  294. X    executed.
  295. X
  296. X    FOREVER
  297. X    Usage    : forever command
  298. X    or    : forever "command;command;command..."
  299. X
  300. X    The specified commands are executed over and over again forever.
  301. X
  302. X    -Execution stops if you hit ^C
  303. X    -If the commands return with an error code.
  304. X
  305. X    FORLINE
  306. X    Usage    : forline var filename command
  307. X    or    : forline var filename "command;command..."
  308. X    Example    : forline i RAM:temp "echo line $_linenum=$i"
  309. X
  310. X    For each ASCII line of file specified commands are executed and
  311. X    var points to line content. You can check system variable _linenum
  312. X    to find the number of the line currently read.
  313. X    If STDIN (case sensitive) is specified as input file, the lines are
  314. X    read from standard input.
  315. X
  316. X    FORNUM
  317. X    Usage    : fornum [-v] var n1 n2 command
  318. X    or    : fornum [-v] -s var n1 n2 step command
  319. X    Example    : fornum -v x 1 10 echo $1
  320. X    or    : fornum -s x 10 1 -1 echo $i # counts backwards
  321. X
  322. X    Executes  command(s)  for  all numerical values of x between n1 and
  323. X    n2.   If  more  than  one  command  is  specified,  or  command  is
  324. X    redirected, include command(s) in quotes.
  325. X    Switch -v (verbose) causes printing of progressive numbers.
  326. X    Switch  -s  allows  you to specify a step; if this is negative, the
  327. X    count will be backwards.
  328. X
  329. X    GETENV
  330. X    Usage    : getenv [shellvar] envvar
  331. X
  332. X    Gets the value of an ARP or ENV: variable (ARP list searched first)
  333. X    and stores it in the shell variable 'shellvar'. If shellvar is
  334. X    omitted, the value of the ENV: variable is printed to stdout.
  335. X
  336. X    GOTO
  337. X    Usage    : goto label
  338. X    Example    :
  339. X          label start
  340. X            echo "At start"
  341. X            dir ram:
  342. X            goto start
  343. X
  344. X    Goto  the specified label name.  You can only use this command from
  345. X    a  source  file.   Labels  may  be  forward or reverse from current
  346. X    position. It is legal to jump out of if's.
  347. X
  348. X    HEAD
  349. X    Usage    : head filename [num]
  350. X    Example    : head readme 20
  351. X
  352. X    Display  first "num" lines of "filename".  If num is not specified,
  353. X    10 is assumed.
  354. X
  355. X    HELP
  356. X    Usage    : help
  357. X    Example    : help
  358. X
  359. X    Simply  displays  all  the  available  commands.   The commands are
  360. X    displayed in search-order.  That is, if you give a partial name the
  361. X    first  command  that  matches  that  name  in  this list is the one
  362. X    executed.   Generally,  you  should  specify enough of a command so
  363. X    that it is completely unique.
  364. X
  365. X    HISTORY
  366. X    Usage    : history [partial_string]
  367. X    Example    : history
  368. X
  369. X    Displays  the  enumerated  history  list.   The size of the list is
  370. X    controlled  by  the  _history  variable.   If you specify a partial
  371. X    string, only those entries matching that string are displayed.
  372. X
  373. X    HOWMANY
  374. X    Usage    : howmany
  375. X
  376. X    This  command  tells you how many instances of Shell are running in
  377. X    your system.
  378. X
  379. X    HTYPE
  380. X    Usage    : htype file1 .. filen
  381. X
  382. X    Displays the specified files in hex and ASCII, just like the system
  383. X    command Type file opt h.  Especially suitable for binary files.
  384. X
  385. X    IF
  386. X    Usage    : if [-n] argument conditional argument ;
  387. X    or    : if [-n] argument
  388. X    or    : if [-n] -f file
  389. X    or    : if [-n] -d file/dir
  390. X    or    : if [-n] -m
  391. X    or    : if [-n] -t file file1 .. fileN
  392. X    or    : if [-n] -r rpnexpression
  393. X    or    : if [-n] -v varname
  394. X
  395. X    If a single argument is something to another argument.  Conditional
  396. X    clauses allowed:
  397. X
  398. X    <, >, =, and combinations (wire or).  Thus <> is not-equal, >=
  399. X    larger or equal, etc...
  400. X
  401. X    If arguments are not numeric, they are compared as strings.
  402. X
  403. X    Usually the argument is either a constant or a variable ($varname).
  404. X
  405. X    The second form if IF is conditional on the existance of the argument.
  406. X    If the argument is a "" string, then FALSE, else TRUE.
  407. X
  408. X    The third form of IF used by -f switch checks for existance of
  409. X    the specified file.
  410. X
  411. X    Switch -d tests the type of the object specified: if it is a
  412. X    directory, then TRUE; if it is a file (or it doesn't exist)
  413. X    then FALSE.
  414. X
  415. X    Switch -m is used to test if FAST memory is present.
  416. X    Example (to be included in a login.sh file):
  417. X    if -m; resident -d lc1 lc2 blink; endif
  418. X
  419. X    Using -t form compares the date and time of the first file with
  420. X    all the others; if the first is younger than ALL the others, then
  421. X    FALSE, else TRUE. If a file doesn't exists, it is considered as
  422. X    being older.
  423. X    This feature is especially useful for building makefiles without
  424. X    using any MAKE utility.
  425. X    Example:
  426. X    if -t test.o test.asm test.i ; asm -o test.o test.asm ; endif
  427. X
  428. X    Option -r evaluates a given RPN expression (see under RPN for more
  429. X    info): if value on top of stack is 0, then FALSE, else TRUE.
  430. X
  431. X    Switch -n (NOT) reverses the result.
  432. X
  433. X    To test if a given variable is defined, use if -v varname.
  434. X
  435. X    When using 'IF' command interactively if you are entering commands
  436. X    following an 'IF' that was false, the prompt will be set to a
  437. X    underscore '_ ' to indicate all commands will be ignored until
  438. X    an 'ELSE' or 'ENDIF' command is seen.
  439. X
  440. X    INC
  441. X    Usage    : inc varname [value]
  442. X    Example    : inc abc 5
  443. X
  444. X    Increment the numerical equivalent of the variable with specified
  445. X    value (default: 1) and place the ascii-string result back into
  446. X    that variable.
  447. X
  448. X    INFO
  449. X    Usage    : info [path1 path2 ... pathN]
  450. X
  451. X    If called without arguments, info gives you the drive information
  452. X    on all devices. If one or more paths are specified, only infor-
  453. X    mation on those drives will be displayed.
  454. X
  455. X    INPUT
  456. X    Usage    : input [-s] var var ... var
  457. X    Example    : input abc
  458. X
  459. X    Input from STDIN (or a redirection, or a pipe) to a variable.  The
  460. X    next input line is broken up in words (unless quoted) and placed in
  461. X    the variable. If -s is turned on, the whole line is read in as one
  462. X    word, including spaces. -r puts the console to single character mode
  463. X    before reding.
  464. X
  465. X    JOIN
  466. X    Usage    : join [-r] file1..fileN destfile
  467. X    Example    : join part1 part2 part3 total
  468. X
  469. X    Joins the specified files to get destfile. If destfile already
  470. X    exists, an error message is generated and operation is aborted,
  471. X    unless you specify -r (replace) option.
  472. X
  473. X    KEYMAP
  474. X    Usage    : keymap number {key=function}
  475. X    Example    : keymap 0 1030=4 1032=12
  476. X
  477. X    Defines one keymap for the cshell command line editing. See chapter
  478. X    XV.
  479. X
  480. X    LABEL
  481. X    Usage    : label name
  482. X
  483. X    Create a program label right here. Used in source files, can then
  484. X    GOTO a label.
  485. X
  486. X    LINECNT
  487. X    Another filter. Counts the number of lines of its stdin and writes
  488. X    it to stdout.
  489. X
  490. X    LOCAL
  491. X    Usage: local [var...var]
  492. X
  493. X    Creates one or more local variables. Those variables disappear at
  494. X    at the end of their alias or source file, and cannot be accessed
  495. X    from inside other aliases or source files.
  496. X    With no arguments, shows all local variables and their values.
  497. X
  498. X    LS
  499. X    Equivalent to dir.
  500. X
  501. X    MD
  502. X    Equivalent to mkdir.
  503. X
  504. X    MAN
  505. X    Usage    : man command(s)
  506. X    Example    : man mkdir
  507. X
  508. X    Get  info about a Shell command, or others keywords.  These include
  509. X    all  special  _variables, plus various keywords:  WILDCARDS, PIPES,
  510. X    EDITING, STARTUP and more.
  511. X    See special alias manlist to get a list of ALL keywords supported
  512. X    by man.
  513. X    You  must set _man to the paths of your .doc files:
  514. X       set _man dh1:docs/aliases.doc dh1:docs/csh.doc
  515. X
  516. X    To create your own .doc files, precede all your keywords by four
  517. X    blanks. 'man' will then display lines until the first character
  518. X    of a line is alphanumeric or has four leading blanks.
  519. X
  520. X    MEM
  521. X    Usage    : mem [-cfqu]
  522. X
  523. X    Options:
  524. X      -c shows the free chip mem only
  525. X      -f shows the free fast mem only
  526. X      -q outputs just a number without titles
  527. X      -s stores current free memory
  528. X      -r shows memory used relative to last stored 
  529. X
  530. X    MENU
  531. X    Usage    : menu [-n] [ title item...item ]
  532. X    Example    : menu Shell   JrComm,,j   Rename,"rename ",r  quit
  533. X
  534. X    Appends one pull down in the current console window. Up to six
  535. X    menus with 16 items every can be installed.
  536. X
  537. X    If the item is just a string, that string will be in the menu item.
  538. X    When you select it, it will be put into the prompt and executed.
  539. X
  540. X    If there is a comma and after that comma a second string, this
  541. X    will be the command will be inserted at the prompt. This time you
  542. X    have to add the ^M yourself if you want the command to be executed.
  543. X
  544. X    If there is a second comma, the letter after that comma will be
  545. X    the keyboard shortcut for that menu item. (This will be case 
  546. X    sensitive some day, use lowercase).
  547. X
  548. X    If for any reason your current menu is corrupt, just enter an
  549. X    empty 'menu' command.
  550. X
  551. X    To clear all existing menus use option -n.
  552. X
  553. X    MKDIR (MD)
  554. X    Usage    : mkdir name name name...
  555. X    Example    : mkdir df0:stuff
  556. X
  557. X    Create the specified directories.
  558. X
  559. X    MV
  560. X    Equivalent to rename.
  561. X
  562. X    OPEN
  563. X    Usage    : open filename filemode filenumber
  564. X    Example    : open RAM:data w 1
  565. X
  566. X    This  allows you to open a file, redirect to it as many commands as
  567. X    you like, then close it.
  568. X    Filename is any valid AmigaDOS filename, filemode is either "r" for
  569. X    read or "w" for write, filenumber is a number between 1 and 10.
  570. X    To  redirect  a  program to or from an open file, use as your redir
  571. X    filename a dot followed by the filenumber.
  572. X    Here is a complete example:
  573. X
  574. X        open RAM:data w 1
  575. X        echo -n 2+2= >.1
  576. X        rpn 2 2 + . CR >.1
  577. X        close 1
  578. X        type RAM:data    # will display 2+2=4
  579. X
  580. X    See also close, flist.
  581. X
  582. X    PATH
  583. X    Usage    : path [-r] [dir...dir]
  584. X
  585. X    Without arguments, lists AmigaDOS path. Otherwise adds given directories
  586. X    to the path, preventing duplicate entries.
  587. X    Options:
  588. X     -r Resets the path
  589. X
  590. X    PRI
  591. X    Usage    : pri clinumber pri
  592. X    Example    : pri 3 5    # set priority of cli #3 to 5
  593. X
  594. X    Change the priority of the specified task (use PS command to
  595. X    determine clinumber). If you specify 0 as clinumber you can
  596. X    change priority of "this" task (the one executing shell).
  597. X
  598. X    PROTECT
  599. X    Usage    : protect file1 ... filen [+|-|=][flags]
  600. X    Example    : protect myfile +rwe
  601. X
  602. X    Set AMIGADOS file protection flags for the file specified. Valid
  603. X    flags are h, s, p, a, r, w, e, d. Modes:
  604. X      +  Set specified bits, leave all others
  605. X      -  Clear specified bits, leave all others
  606. X      =  Set specified bits, clear all others
  607. X    Specifying no mode is equal to '='. Archive bit cleared by default.
  608. X
  609. X    PS
  610. X    Usage    : ps [commandname...commandname]
  611. X
  612. X    Gives status of CLI processes.  eg:
  613. X
  614. X    Proc Command Name    CLI Type    Pri.  Address  Directory
  615. X    * 1  csh            Initial CLI   0      97b0  Stuff:shell
  616. X      2  clock            Background  -10    2101a8  Workdisk:
  617. X      3  emacs            Background    0    212f58  Stuff:shell
  618. X      4  VT100            Background    0    227328  Workdisk:
  619. X
  620. X    Address is the address of the task, directory is the process
  621. X    currently CD'd directory. My default, only the BaseNames of
  622. X    the commands are shown. Your own CLI will be marked by an
  623. X    asterisk in the first column.
  624. X    Options:
  625. X     -l shows full pathnames of commands
  626. X     -e excludes the given command names from the list
  627. X
  628. X    PWD
  629. X    Usage    : pwd
  630. X
  631. X    Rebuild _cwd by backtracing from your current directory.
  632. X
  633. X    QSORT
  634. X    Usage   : qsort [-r] <in >out
  635. X
  636. X    Quick sorts from stdin to stdout. -r causes reverse sorting.
  637. X
  638. X    QUIT
  639. X    Usage    : quit
  640. X
  641. X    Quit out of Shell back to CLI.
  642. X
  643. X    RBACK
  644. X    Usage    : rback command
  645. X
  646. X    Start a new process executing the specified command, but can't do
  647. X    input/output. Equivalent to 'run command >NIL: <NIL:'. Instead of
  648. X    using rback, you can add a '&' at the end of the command line. The
  649. X    variable $_newproc will hold the cli number of the newly created
  650. X    process.
  651. X    Note: rback cannot start builtin commands. You have to start a
  652. X          subshell: rback csh -c "copy ram:temp prt:;rm ram:temp
  653. X
  654. X    READFILE
  655. X    Usage    : readfile varname [filename]
  656. X
  657. X    Completely reads a (short!) ascii file and assigns it to a variable.
  658. X    Each line becomes one word in the resulting string. Embedded blanks
  659. X    are no problem. If file name is omitted, stdin is used.
  660. X
  661. X    RENAME (MV)
  662. X    Usage    : rename from to
  663. X    or    : rename from from from ... from todir
  664. X
  665. X    Allows you to rename a file or move it around within a disk.
  666. X    Allows you to move 1 or more files into a single directory.
  667. X    The archive bit of the file(s) will be cleared.
  668. X
  669. X    RESIDENT
  670. X    Usage    : resident [-r][-d] [files]
  671. X    Example    : resident lc1 lc2 blink    # load these as resident
  672. X          resident -d lc1 lc2 blink    # defer load when needed
  673. X          resident -r lc1 lc2 blink    # remove these
  674. X          resident            # list resident programs
  675. X
  676. X    This is ARP resident. Commands are searched by Shell in resident
  677. X    list BEFORE of searching on any external device.
  678. X    Only PURE programs can run as resident, see ARP docs for more info.
  679. X    Option -d is very useful: you can say, in your startup file,
  680. X    resident -d file...file; programs will not be loaded immediately,
  681. X    but only when you will try to load them. This way, you will not
  682. X    waste memory and startup time if you don't use the programs.
  683. X    Old option -a has no more effect.
  684. X
  685. X    RETURN
  686. X    Usage    : return [n]
  687. X    Example    : return 10
  688. X
  689. X    Exit from a script file, or quit from shell with optional
  690. X    exit code.
  691. X
  692. X    RM
  693. X    Equivalent to delete.
  694. X
  695. X    RPN
  696. X    Usage    : rpn expression
  697. X    Example    : rpn 3 7 *    # Prints the value 21
  698. X
  699. X    Evaluate an RPN expression, using 32-bit values. In older versions
  700. X    of Shell RPN contained string functions too, but now that strings
  701. X    are handled by specifical commands, these are no more needed.
  702. X    At end of evaluation, RPN prints values on stack, so you can
  703. X    say for instance "rpn $x 2 * | input x" to double the value of
  704. X    variable x.
  705. X    Functions implemented are:
  706. X
  707. X        + - * /    Obvious meaning; / means integer division, of course
  708. X        %        Module operator e.g. "rpn 7 3 %" answers 1
  709. X        & | ~    Bitwise and, or, not operators
  710. X        > < ==    Tests for greater-than, lower-than, equal. To get
  711. X            a test for >= (or <=), you can use < ! (or > !)
  712. X        !        Logical not operator
  713. X        DUP        Duplicate value on top of stack
  714. X        DROP    Drop value on top of stack
  715. X        SWAP    Swap two values on top of stack
  716. X
  717. X    To avoid confusion with redirections, > and < operators must be
  718. X    enclosed in quotes e.g.
  719. X
  720. X        3 2 ">"        # Prints 1
  721. X
  722. X    RUN
  723. X    Usage    : run prgm args
  724. X    Example    : run emacs test.c
  725. X
  726. X    Start a new process executing the specified command.
  727. X    In current implementation run command can't be redirected.
  728. X    This command is not fully reliable: use at your own risk.
  729. X    $_newproc will hold the cli number of the new process.
  730. X    See also rback.
  731. X
  732. END_OF_FILE
  733. if test 22783 -ne `wc -c <'csh.doc.ab'`; then
  734.     echo shar: \"'csh.doc.ab'\" unpacked with wrong size!
  735. fi
  736. # end of 'csh.doc.ab'
  737. fi
  738. if test -f 'csh.doc.ac' -a "${1}" != "-c" ; then 
  739.   echo shar: Will not clobber existing file \"'csh.doc.ac'\"
  740. else
  741. echo shar: Extracting \"'csh.doc.ac'\" \(23279 characters\)
  742. sed "s/^X//" >'csh.doc.ac' <<'END_OF_FILE'
  743. X    RXREC
  744. X    Usage    : rxrec [portname]
  745. X
  746. X    Create an AREXX-compatible port of the specified name (defaults to
  747. X    "rexx_csh"), then puts Shell to sleep waiting for messages on it.
  748. X
  749. X    CAUTION: the only way to exit from this status is to send to the port
  750. X    the message "bye".
  751. X
  752. X    Example:
  753. X    Open two Shell's in two separate CLI's. From the first, type:
  754. X
  755. X        rxrec
  756. X
  757. X    Now first Shell doesn't respond to keyboard input; instead, it waits
  758. X    for messages on a port called "rexx_csh". Now, from the other, type:
  759. X
  760. X        rxsend rexx_csh "dir df0:"
  761. X
  762. X    You will see the listing of df0: in the first Shell. Experiment as you
  763. X    like, then:
  764. X
  765. X        rxsend rexx_csh bye
  766. X
  767. X    And all will return to normal.
  768. X
  769. X    RXSEND
  770. X    Usage    : rxsend [-lr] portname command...command
  771. X
  772. X    Send commands to any program with an AREXX-compatible port. Be aware
  773. X    that every word is sent as a single command!
  774. X
  775. X    You don't have to load anything to use these command (or rxrec):
  776. X    all you need is a program with the right port.
  777. X
  778. X    An example is CygnusEdProfessional: here is, for instance, a command
  779. X    to wake it up, load the file test.c and jump to line 20:
  780. X
  781. X        rxsend rexx_ced cedtofront "open test.c" "jmp to line 20"
  782. X        # rexx_ced is the name of AREXX port for CygnusEd
  783. X
  784. X    The option -r sets the variable _result to the result string
  785. X    of the AREXX command.
  786. X    The option -l send the whole line as *one* command.
  787. X
  788. X    Refer to your application manual for details and for the names
  789. X    of the commands and the port.
  790. X
  791. X    SEARCH
  792. X    Usage    : search [-abcefnqrvw] file...file string
  793. X
  794. X    Search specified files for a string. Only lines containing the
  795. X    specified strings are displayed.
  796. X
  797. X    If the filename is STDIN (in uppercase), the standard input is
  798. X    used, so you can use search as the destination for a pipe.
  799. X    Example:
  800. X        strings myprog 8 | search STDIN .library
  801. X    Lists all libraries used in "myprog".
  802. X
  803. X    Search is very fast if none of the options -w, -e and STDIN was
  804. X    specified and the file fits into memory.
  805. X
  806. X    Options:
  807. X      -a (abort)   stops search as soon as the pattern was found once
  808. X      -b (binary)  shows only byte offsets instead of lines. If combined
  809. X                   with -n, shows naked numbers. 
  810. X      -c (case)    turns ON case sensitivity
  811. X      -e (exclude) lists lines NOT containing the pattern
  812. X      -f (files)   causes only the names of the files in which the pat-
  813. X                   tern was found to be displayed.
  814. X      -l (left)    pattern must be at beginning of line (this is faster
  815. X                   than using a wild card)
  816. X      -n (number)  turns off line numbering
  817. X      -o (only)    finds only whole words
  818. X      -q (quiet)   suppresses printing of file names.
  819. X      -r (recurse) if you specify any directory, all files in that di-
  820. X                   rectory are recursively searched.
  821. X      -v (verbose) shows each file name on a single line. this is auto-
  822. X                   matically turned on if search is redirected
  823. X      -w (wild)    wild card matching. see notes below
  824. X
  825. X    Notes to wild card matching;
  826. X    - Uses Shell standard matching.
  827. X    - All standard ARP wildcards are allowed * ? [] () | ~ ' #
  828. X    - The WHOLE line must match the string, not only a substring.
  829. X    - String MUST be enclosed in quotes to avoid wildcard expansion
  830. X
  831. X    Examples:
  832. X        search -cr df0:include ACCESS
  833. X    Find all occurrencies of ACCESS (in uppercase) in all files
  834. X    contained in include directory.
  835. X        search -w shell.h "'#define*"
  836. X    Lists only lines of file beginning with (not simply containing)
  837. X    #define. Note the use of ' to escape the special symbol #.
  838. X
  839. X    SET
  840. X    Usage    : set [name] [string]
  841. X    Example    : set abc hello
  842. X
  843. X    Set with no args lists all current variable settings.
  844. X    Set with one arg lists the setting for that particular variable.
  845. X    Specifying name and string, stores the string into variable name.
  846. X
  847. X    Also See the section on special _variables.
  848. X
  849. X    SETENV
  850. X    Usage    : setenv envvar value
  851. X
  852. X    Sets an ENV: variable to the given value. The value must be
  853. X    enclosed in quotes if it contains spaces.
  854. X
  855. X    SLEEP
  856. X    Usage    : sleep timeout
  857. X    Example    : sleep 10
  858. X
  859. X    Sleep for 'timeout' seconds, or until ^C typed.
  860. X
  861. X    SPLIT
  862. X    Usage    : split srcvar dstvar...dstvar
  863. X
  864. X    Assigns one word of srcvar to every dstvar, the rest of srcvar to
  865. X    the last dstvar.
  866. X    Note: You enter variable NAMES, not variables.
  867. X
  868. X    STACK
  869. X    Usage    : stack [number]
  870. X    Example    : stack 8000
  871. X
  872. X    Changes the default stack for this CLI. Without arguments, prints
  873. X    it.
  874. X
  875. X    STRHEAD
  876. X    Usage    : strhead varname breakchar string
  877. X    Example    : strhead x . foobar.bas    # Will set x to "foobar"
  878. X
  879. X    Remove everything after and including the breakchar in 'string' and
  880. X    place in variable 'varname'.
  881. X
  882. X    STRINGS
  883. X    Usage    : strings file1..fileN minlenght
  884. X    Example    : strings c:dir c:list shell 7
  885. X
  886. X    Prints strings contained in specified files (usually binary)
  887. X    with lenght >= minlenght.
  888. X
  889. X    STRLEFT
  890. X    Usage    : strleft varname string n
  891. X    Example    : strleft x LongString 5    # Will set x to "LongS"
  892. X
  893. X    Place leftmost n chars of string in variable varname.
  894. X
  895. X    STRLEN
  896. X    Usage    : strlen varname string
  897. X    Example    : strlen x Hello        # Will set x to "5"
  898. X
  899. X    Puts len of string in variable varname.
  900. X
  901. X    STRMID
  902. X    Usage    : strmid varname string n1 [n2]
  903. X    Example    : strmid x LongString 5 3    # Will set x to "Str"
  904. X
  905. X    Places n2 chars from string, starting at n1, in variable varname.
  906. X    By omitting n2, you get all chars from n1 to end of string.
  907. X
  908. X    STRRIGHT
  909. X    Usage    : strright varname string n
  910. X    Example    : strright x LongString 5    # Will set x to "tring"
  911. X
  912. X    Place rightmost n chars of string in variable varname.
  913. X
  914. X    STRTAIL
  915. X    Usage    : strtail varname breakchar string
  916. X    Example    : strtail x . foobar.bas    # Will set x to "bas"
  917. X
  918. X    Remove everything before and including the breakchar in 'string' and
  919. X    place in variable 'varname'.
  920. X
  921. X    SOURCE
  922. X    Usage    : source file [arguments]
  923. X    Example    : source mymake.sh all
  924. X    Result    : barch file 'mymake.sh' called with var _passed = 'all'
  925. X
  926. X    Execute commands from a file.  You can create SHELL programs in
  927. X    a file and then execute them with this command.  Source'd files
  928. X    have the added advantage that you can have loops in your command
  929. X    files (see GOTO and LABEL).  You can pass SOURCE files arguments
  930. X    by specifying arguments after the file name.  Arguments are passed
  931. X    via the _passed variable (as a single string, a set of words).
  932. X
  933. X    Long lines may be split by appending a backslash (\) at end of
  934. X    first part. One single line must be shorter than 512 bytes, but
  935. X    the concatted line can be as long as you want. There is no limit
  936. X    on the length of the concatted line.
  937. X
  938. X    Automatic 'sourcing' is accomplished by appending a .sh suffix to
  939. X    the file and executing it as you would a C program:
  940. X
  941. X    --------- file hello.sh ---------
  942. X    foreach i ( $_passed ) "echo yo $i"
  943. X    ---------------------------------
  944. X
  945. X    $ hello a b c
  946. X    yo a
  947. X    yo b
  948. X    yo c
  949. X
  950. X    If the last character of a line in a source file is '{', all
  951. X    following lines will appended to the current one and separated
  952. X    by semicolons until the last character of a line is '}'. Those 
  953. X    blocks may be nested.
  954. X
  955. X    --------- file login.sh ---------
  956. X    alias complex {
  957. X      echo -n "this   alias   "
  958. X      echo "works!"
  959. X    }
  960. X    ---------------------------------
  961. X
  962. X    $ login
  963. X    $ complex
  964. X    this   alias   works!
  965. X
  966. X
  967. X    TACKON
  968. X    Usage    : tackon var pathname filename
  969. X    Example    : tackon x df0:c Dir    # sets x to "df0:c/Dir"
  970. X    or    : tackon x df0: Preferences #sets x to "df0:Preferences"
  971. X
  972. X    Correctly  adds  a  filename  to a pathname, and puts the result in
  973. X    variable specified.
  974. X
  975. X    TAIL
  976. X    Usage    : tail filename [num]
  977. X    Example    : tail readme 20
  978. X
  979. X    Display  last  "num" lines of "filename".  If num is not specified,
  980. X    10 is assumed.
  981. X
  982. X    TEE
  983. X    Usage    : tee [file]
  984. X    Example    : cc test.c | tee >error.list
  985. X
  986. X    Copies stdin to stdout and the given file. If file is omitted, sterr
  987. X    is used.
  988. X
  989. X    TOUCH
  990. X    Usage    : touch file1 .. fileN
  991. X
  992. X    Sets DateStamp of the specified files to the current date & resets
  993. X    archive bit.
  994. X
  995. X    TRUNCATE
  996. X    Usage    : truncate [n]
  997. X    Example : alias | sort | truncate
  998. X
  999. X    A filter that truncates the width of stdin to the specified number,
  1000. X    trying to account for tab's and escape sequences. If the number is
  1001. X    omitted, the current window width is used.
  1002. X
  1003. X    TYPE
  1004. X    Equivalent to CAT.
  1005. X
  1006. X    UNALIAS
  1007. X    Usage    : unalias name .. name
  1008. X    Example    : unalias vt
  1009. X
  1010. X    Delete aliases..
  1011. X
  1012. X    UNIQ
  1013. X    Usage    : uniq
  1014. X
  1015. X    This is a  filter that removes consecutive, duplicated lines in a
  1016. X    file.  It is most useful on a sorted file.
  1017. X
  1018. X    UNLOCAL
  1019. X    Usage    : unlocal var ... var
  1020. X
  1021. X    Deletes one or more local variables
  1022. X
  1023. X    UNSET
  1024. X    Usage    : unset name .. name
  1025. X    Example    : unset abc
  1026. X
  1027. X    Unset one or more variables.  Deletes them entirely.
  1028. X
  1029. X    USAGE
  1030. X    Usage    : usage [command...command]
  1031. X
  1032. X    If called without arguments, usage gives you a short information
  1033. X    on the special characters used. Otherwise, usage shows you the
  1034. X    usage of the given commands. Calling a command with a '?' as
  1035. X    the only argument will show its usage, too.
  1036. X
  1037. X    VERSION
  1038. X    Usage    : version
  1039. X
  1040. X    Show current version name, & authors.
  1041. X
  1042. X    WAITFORPORT
  1043. X    Usage    : waitforport portname [seconds]
  1044. X
  1045. X    Waits for a port to come up. Default time is 10 seconds.
  1046. X
  1047. X    WHEREIS
  1048. X    Usage    : whereis [-r] filename [ device1...deviceN ]
  1049. X
  1050. X    If just a file name is given, cd searches all subdirectories of the
  1051. X    current directory for that file. An asterisk '*' is appended to the
  1052. X    file. Wild cards are allowed for the file (no asterisk will be
  1053. X    appended then ), but no path names. If additional arguments are
  1054. X    given, whereis searches only these paths, not the current directory.
  1055. X    whereis -r looks on all drives.
  1056. X
  1057. X    WINDOW
  1058. X    Usage    : window [-q][-f][-b][-l][-s] [dimensions]
  1059. X    Options    :
  1060. X        -f    (front) Window to front
  1061. X        -b    (back)  Window to back
  1062. X        -l    (large) Window to maximum size
  1063. X        -s    (small) Window to minimum size
  1064. X        -a    (activate)
  1065. X        -q    (query) Lists screens and windows open
  1066. X
  1067. X       Various  operations on CLI window.  If dimensions are specified,
  1068. X    they must be in the form x y width height, with values separated by
  1069. X    spaces.
  1070. X       The  command  "window  -l" may be very useful on PAL machines to
  1071. X    get  a  full  PAL  window  from  your login sequence, or if you use
  1072. X    overscan WorkBench.
  1073. X       Option  -q  gives,  for  each  Screen and Window currently open,
  1074. X    title, left edge, top edge, width, height.
  1075. X
  1076. X
  1077. XIX. SPECIAL SET VARIABLES
  1078. X-------------------------
  1079. X
  1080. X    _abbrev
  1081. X    If set to 'n', internal commands can no longer be abbreviated.
  1082. X
  1083. X    _bground
  1084. X    True if the shell was started with a non-interactive input.
  1085. X
  1086. X    _clinumber
  1087. X    Contains the number (1-20) of current CLI.
  1088. X
  1089. X    _cwd
  1090. X    Holds a string representing the current directory we are in from
  1091. X    root.  The SHELL can get confused as to its current directory if
  1092. X    some external program changes the directory.  Use PWD to rebuild
  1093. X    the _cwd variable in these cases.
  1094. X
  1095. X    _debug
  1096. X    Debug mode... use it if you dare.  must be set to some value
  1097. X
  1098. X    _every
  1099. X    Contains the name of a command that is output every time just before
  1100. X    the prompt is printed. Do not use this to echo the prompt.
  1101. X
  1102. X    _except
  1103. X    See EXCEPTION
  1104. X
  1105. X    _hilite
  1106. X    Holds the font attributes used for highlighting. One letter for one
  1107. X    attribute:
  1108. X      b    for bold
  1109. X      i    for italic
  1110. X      u    for underlined
  1111. X      r    for reverse
  1112. X      c3   for foreground color 3
  1113. X      c3,2 for foreground color 3 and background color 2
  1114. X    Any combinations are allowed. _hilite defaults to "c7", in terminal
  1115. X    mode to "r".
  1116. X
  1117. X    _history
  1118. X    This variable is set to a numerical value, and specifies how far
  1119. X    back your history should extend. Set it to 0 to disable history,
  1120. X    for example if you test your programs for memory leaks. Defaults
  1121. X    to 50.
  1122. X
  1123. X    _insert
  1124. X    Sets the default for insert/overtype mode for command line
  1125. X    editing. ^A toggles between, but after <RET> the default is
  1126. X    set back as indicated by this variable. By default _insert is 1
  1127. X    indicating insert mode on setting to zero will make overtype
  1128. X    the default.
  1129. X
  1130. X    _ioerr
  1131. X    Contains the secondary error code for the last command. Will be
  1132. X    changed after every external command and after a failed internal
  1133. X    command. See @ioerr( )
  1134. X
  1135. X    _kick2x
  1136. X    True if dos.library V36 could be opened (which means that kickstart
  1137. X    2.0 is around)
  1138. X
  1139. X    _lasterr
  1140. X    Return code of last command executed.  This includes internal
  1141. X    commands as well as external comands, so to use this variables
  1142. X    you must check it IMMEDIATELY after the command in question.
  1143. X
  1144. X    _lcd
  1145. X    Holds the name of the last directory. The builtin alias 'dswap'
  1146. X    cd's to that directory. If called again, you're back where you
  1147. X    were.
  1148. X
  1149. X    _man
  1150. X    The path and name of your .doc file. Defaults to 'csh:csh.doc'
  1151. X
  1152. X    _maxerr
  1153. X    The worst (highest) return value to date.  To use this, you usually
  1154. X    set it to '0', then do some set of commands, then check it.
  1155. X
  1156. X    _minrows
  1157. X    Gives the minimum number of rows a window must have to turn on quick
  1158. X    scrolling. Defaults to 34.
  1159. X
  1160. X    _nobreak
  1161. X    If set to some value, disables CTRL-C.
  1162. X
  1163. X    _noreq
  1164. X    If set to some value , disables system requesters ("Please insert
  1165. X    volume ...."). Turned on in vt200 mode.
  1166. X
  1167. X    _passed
  1168. X    This variable contains the passed arguments when you SOURCE a file
  1169. X    or execute a .sh file.  For instance:
  1170. X
  1171. X    test a b c d
  1172. X
  1173. X    -------- file test.sh ----------
  1174. X    echo $_passed
  1175. X    foreach i ( $_passed ) "echo YO $i"
  1176. X    --------------------------------
  1177. X
  1178. X    _path
  1179. X    Tells CShell where to look for executable files. The current direc-
  1180. X    tory and the AmigaDOS path will be searched first. The trailing
  1181. X    slash for directories is not necessary anymore.  The entire path
  1182. X    will be searched first for the <command>, then for <command>.sh
  1183. X    (automatic shell script sourcing). Example:
  1184. X        set _path ram:c,ram:,sys:system,dh1:tools,df0:c
  1185. X    (This path has the advantage that these directories need not even
  1186. X     exist, that you can access devices (AmigaDOS path only knows 
  1187. X     volumes under Kick 1.3) and that no disk seeks happen at startup)
  1188. X
  1189. X    _prompt
  1190. X    This variable now can contain the following control characters:
  1191. X     %c  for color change. This highlights your prompt. See _hilite
  1192. X     %m  for memory. This shows your current memory in K
  1193. X     %t  for time. This shows your current time in the format HH:MM:SS
  1194. X     %d  for date. This shows the current date in the format DD-MMM-YY
  1195. X     %p  for path. This inserts the current path
  1196. X     %n  for number. This inserts the current process number
  1197. X     %v  for version. This shows the version number of CShell
  1198. X     %h  for history. This displays the current history number
  1199. X     %f  for free store. This shows the free store on the current drive
  1200. X     %r  for pRiority. Inserts the task priority of the current
  1201. X    The default for prompt is now "%c%p> "
  1202. X    The  if  command  will  set the prompt to a '_ ' if commands are
  1203. X    disabled while waiting for a 'endif' or 'else' command (interactive
  1204. X    mode only.
  1205. X
  1206. X    _pipe
  1207. X    The directory where temporaries are stored. Default: 'T:'
  1208. X
  1209. X    _qcd
  1210. X    Holds the name of the file where the all directories on your hard 
  1211. X    disk are stored. If not set, defaults to csh:csh-qcd.
  1212. X
  1213. X    _rxpath
  1214. X    The same as with _path, but this is where CShell looks for .rexx
  1215. X    files. Defaults to REXX:
  1216. X
  1217. X    _scroll
  1218. X    Holds the number of lines to be scrolled at once when quick scrolling
  1219. X    is used. If unset or <=1, quick scrolling is off. Defaults to 3.
  1220. X
  1221. X    _terminal
  1222. X    Indicated whether or not shell was started in terminal mode.
  1223. X
  1224. X    _titlebar
  1225. X    The same control characters as for the _prompt can be used for
  1226. X    _titlebar, too. The only difference is that %c is ignored. The
  1227. X    titlebar is updated every time before the prompt appears.
  1228. X
  1229. X    _verbose
  1230. X    If set to 's', turns on verbose mode for source files (every command
  1231. X    will be displayed before being executed). If set to 'a', displays
  1232. X    all substeps while alias substitution. 'h' will hilight the debug
  1233. X    output. Any combination allowed: set _verbose sah
  1234. X
  1235. X    _version
  1236. X    Contains the version number of the shell, e.g. 510.
  1237. X
  1238. X
  1239. XX.   FUNCTIONS
  1240. X--------------
  1241. X
  1242. X    FUNCTIONS
  1243. X    Functions are preceded by an @-sign and may not be abbreviated
  1244. X    They must be preceded by a blank amd a blank must follow the opening
  1245. X    and precede the closing brace. There must be no blank between the
  1246. X    function name an the opening brace.
  1247. X    (NOTE: Later versions of Shell might allow that functions need not
  1248. X           be at the beginning of an argument, so quote any @-signs not
  1249. X           used for functions)
  1250. X
  1251. X    Functions may be nested. The function names themselves are case
  1252. X    sensitive, but the operations (like strcmp) aren't.
  1253. X
  1254. X    Functions can be used as commands. They will echo their return value
  1255. X    to stdout. Note that they can't be abbreviated and that the function
  1256. X    list is searched after the command list. Example:
  1257. X        drives          ---> DF0: DH1: DH2: RAM: WB_2.x:
  1258. X
  1259. X    So far, functions are not user definable.
  1260. X
  1261. X    Note the difference between sets of words and strings. After
  1262. X      set var hello world
  1263. X    $var is a wordset, but after
  1264. X      set var "hello world"
  1265. X    var is one string. Although they look the same if echoed, they
  1266. X    behave different, for example in 'foreach i ( var ) "echo hi'. The
  1267. X    functions @split and @concat convert the two forms.
  1268. X
  1269. X
  1270. X    @abbrev( str1 str2 [len] )
  1271. X    true if the first <len> chars of str1 are an abbreviation of str2
  1272. X    @abs( num )
  1273. X    returns absolute value of <num>
  1274. X    @age( file )
  1275. X    the age of that file in days, 99999 if file not found
  1276. X    @appsuff( name suffix )
  1277. X    appends an suffix ( .ZOO ) to a string if it's not already there
  1278. X    @availmem( [type] )
  1279. X    returns free 'chip', 'fast' or otherwise total memory
  1280. X    @basename( file )
  1281. X    returns the file name of <file> without path
  1282. X    @center( word len )
  1283. X    returns a string of length <len> with <word> centered in it
  1284. X    @checkport( portname )
  1285. X    indicates if given port exists
  1286. X    @clinum( procname )
  1287. X    returns the number of the cli identified by a name or a number
  1288. X    @complete( abbrev word ... word )
  1289. X    returns the first word <abbrev> is an abbreviation of
  1290. X    @concat( word word ... word )
  1291. X    concats all words in one blank separated string, see @split
  1292. X    @confirm( title item ... item )
  1293. X    asks for confirmation of every item and returns the confirmed ones
  1294. X    @console( STDIN|STDOUT )
  1295. X    tells whether stdin or stdout are interactive (not redirected)
  1296. X    @dectohex( number )
  1297. X    returns a string representing <number> in hex
  1298. X    @delword( word word ... word n )
  1299. X    returns a string with the n-th word deleted.
  1300. X    @delwords( word word ... word n m )
  1301. X    deletes the next m words from the n-th.
  1302. X    @dirs( name name name name )
  1303. X    returns the directories among the given file names, see @files
  1304. X    @drive( path )
  1305. X    outputs the drive ( device ) name associated to <path>
  1306. X    @drives( )
  1307. X    outputs all available drives
  1308. X    @exists( file )
  1309. X    tells whether a file exists or not
  1310. X    @fileblks( file file ... file )
  1311. X    returns the # of blocks needed for the files, incl. dir blocks
  1312. X    @filelen( file file ... file )
  1313. X    count the total number of bytes of the given files
  1314. X    @fileprot( file )
  1315. X    returns a string like ---arwed
  1316. X    @filereq( title path&pattern filename )
  1317. X    brings up the arp file requester and returns the selected file name
  1318. X    @files( file file ... file )
  1319. X    gives you the files among those names, no directories. see @dirs
  1320. X    @freebytes( path )
  1321. X    the number of free bytes on the given path
  1322. X    @freeblks( path )
  1323. X    the number of free blocks on the given path
  1324. X    @freestore( path )
  1325. X    the amount of free store on that path, given in K, M and G
  1326. X    @getenv( varname )
  1327. X    returns the value of the named env: variable
  1328. X    @getclass( file )
  1329. X    returns the class (type) of the file. See chapter XIV
  1330. X    @howmany
  1331. X    indicates the # of shells running
  1332. X    @index( string pattern )
  1333. X    returns the index of pattern in string (starting at 1), 0 if not found
  1334. X    @info( path )
  1335. X    the corresponding line from the 'info' command, each entry a word
  1336. X    @intersect( word1 word2 word3 , word4 word5 word6 )
  1337. X    returns all words which are in both lists. see @union, @member
  1338. X    @ioerr( num )
  1339. X    returns the corresponding error string to num
  1340. X    @lookfor( file paths )
  1341. X    looks for a file in the current directory and the paths. See $_path
  1342. X    @lower
  1343. X    lowercases its arguments. see @upper
  1344. X    @match( word ... word "pattern" )
  1345. X    returns the words in the list that match the arp-pattern
  1346. X    @max( num num ... num )
  1347. X    computes the maximum of all given numbers
  1348. X    @megs( number )
  1349. X    expresses a number in K, M and G (-bytes), rounded correctly
  1350. X    @member( word1 word word ... word )
  1351. X    tells you if word1 is among the remaining words
  1352. X    @min( num num ... num )
  1353. X    computes the minimum of all given numbers
  1354. X    @mounted( device )
  1355. X    returns a boolean indicating whether the specified device is mounted
  1356. X    @nameext( filename )
  1357. X    returns all after the last dot of <filename>.
  1358. X    @nameroot( filename )
  1359. X    returns all before the LAST dot of <filename>.
  1360. X    @pathname( path )
  1361. X    strips the base name from a path
  1362. X    @pickargs( arg ... arg )
  1363. X    picks of its arguments those which don't start with a '-'
  1364. X    @pickopts( arg ... arg )
  1365. X    picks of its arguments those which start witch a '-'
  1366. X    @rpn( expression )
  1367. X    computes the rpn expression. See rpn command
  1368. X    @sortargs( name ... name )
  1369. X    sorts its arguments alphabetically
  1370. X    @sortnum( number ... number )
  1371. X    sorts its arguments numerically
  1372. X    @split( string )
  1373. X    makes each blank separated part of @string a word, see @concat
  1374. X    @strcmp( name name )
  1375. X    returns -1, 0 or 1 depending of alphabetical comparison
  1376. X    @strhead( breakchar string )
  1377. X    see strhead command
  1378. X    @strleft( string number )
  1379. X    see strleft command
  1380. X    @strmid( string n1 n2 )
  1381. X    see strmid command
  1382. X    @strright( string n )
  1383. X    see strright command
  1384. X    @strtail( breakchar string )
  1385. X    see strtail command
  1386. X    @subwords( word ... word n m )
  1387. X    returns the next m words word of the given list starting from n
  1388. X    @tackon( path file )
  1389. X    see tackon command
  1390. X    @unique( word ... word )
  1391. X    sorts the arguments and makes each of them unique
  1392. X    @union( name ... name , name ... name )
  1393. X    returns all names that are in either list. See @intersect, @member
  1394. X    @upper( word ... word )
  1395. X    upper cases the given words. see @lower
  1396. X    @volume( path )
  1397. X    returns the volume name in that path or "" (no colon appended)
  1398. X    @winheight( )
  1399. X    outputs the height of your window in pixels
  1400. X    @winleft( )
  1401. X    returns the left edge of your window
  1402. X    @wintop( )
  1403. X    returns the top edge of your window
  1404. X    @winwidth( )
  1405. X    outputs the width of your window in pixels
  1406. X    @without( name ... name , name ... name )
  1407. X    returns all names of list 1 that are not in list 2
  1408. X    @word( name ... name n )
  1409. X    picks the n-th word from the list.
  1410. X    @words( name ... name )
  1411. X    returns the number of words in the list.
  1412. X
  1413. X
  1414. XXI. MISCELLANEOUS
  1415. X-----------------
  1416. X
  1417. X    QUICK SCROLLING
  1418. X    CShell has now allows to do quick scrolling in large windows.
  1419. X    Quick scrolling means that whenever the cursor reaches the bottom
  1420. X    of the window, the text jumps up 3 or more lines at once. However,
  1421. X    only the following commands support this (yet):
  1422. X    - dir, cat, htype, strings, search, truncate, tee
  1423. X    You can choose the number of lines to scroll at once by setting
  1424. X    the variable _scroll. Unsetting it or setting it to a value <=1
  1425. X    completely disables quick scrolling.
  1426. X    You can also choose the number lines a window must at least have
  1427. X    to turn on the quick scrolling by setting the _minrows variable.
  1428. X    (Defaults to 34). Quick scrolling is automatically disabled when
  1429. X    the command is redirected. By piping any command to cat, you can
  1430. X    force it to quick scroll. Example:  List | cat
  1431. X
  1432. X
  1433. X    CLOSING GADGET
  1434. X    CShell now can be terminated using the closing gadget in the
  1435. X    AmigaDOS 2.0 shell window. Don't execute c:ENDCLI while using
  1436. X    the shell. This can cause problems with external commands. The
  1437. X    closing button provides a 'quit' command. You can define
  1438. X      alias quit "Endcli;\\quit
  1439. X    to assert that the CLI window closes when you click the button.
  1440. X
  1441. X
  1442. X    EXCEPTION PROCESSING
  1443. END_OF_FILE
  1444. if test 23279 -ne `wc -c <'csh.doc.ac'`; then
  1445.     echo shar: \"'csh.doc.ac'\" unpacked with wrong size!
  1446. fi
  1447. # end of 'csh.doc.ac'
  1448. fi
  1449. echo shar: End of archive 3 \(of 6\).
  1450. cp /dev/null ark3isdone
  1451. MISSING=""
  1452. for I in 1 2 3 4 5 6 ; do
  1453.     if test ! -f ark${I}isdone ; then
  1454.     MISSING="${MISSING} ${I}"
  1455.     fi
  1456. done
  1457. if test "${MISSING}" = "" ; then
  1458.     echo You have unpacked all 6 archives.
  1459.     rm -f ark[1-9]isdone
  1460. else
  1461.     echo You still need to unpack the following archives:
  1462.     echo "        " ${MISSING}
  1463. fi
  1464. ##  End of shell archive.
  1465. exit 0
  1466. -- 
  1467. Mail submissions (sources or binaries) to <amiga@uunet.uu.net>.
  1468. Mail comments to the moderator at <amiga-request@uunet.uu.net>.
  1469. Post requests for sources, and general discussion to comp.sys.amiga.misc.
  1470.